<div class="part">
  <div class="pic"><%= image_tag('friend/hygl_tj_right1.jpg') %></div>
</div>
<div class="content">
  <% if @friends %>
    <% @friends.each do |friend| %>
      <div class="monomer">
        <div id="picture">
          <%= link_to logo_image_tag(friend, :width => 95, :height => 95),
            valleyer_url(friend),
            :target => :_blank
        %>
        </div>
        <div class="message">
          <div class="name">
            <p>姓名：</p>
            <%= link_to friend.nick_name,
              valleyer_url(friend),
              :target => :_blank
          %>
            <p class="star"><%= image_tag('valleyer/star.jpg') %></p>
          </div>
          <p>资料：</p><b><%= friend.seat %></b>
        </div>
        <div class="operate">
          <%
          wait_requisition = WaitMakeFriendRequisition.has_been_for_friend(current_valleyer_id, friend.id)
          agree_requisition = AgreeMakeFriendRequisition.has_been_for_friend(current_valleyer_id, friend.id)
          reject_requisition = RejectMakeFriendRequisition.has_been_for_friend(current_valleyer_id, friend.id)
        %>
          <% if wait_requisition %>
            <div class="letter" title="于<%= time_ago_in_words wait_requisition.created_at, false %>之前申请">
              正在申请，等待对方同意
            </div>
          <% else %>
            <% if agree_requisition %>
              <div class="letter" title="于<%= time_ago_in_words agree_requisition.updated_at, false %>之前通过">
                对方已同意你的交友申请
              </div>
            <% else %>
              <% if reject_requisition %>
                <div class="letter" title="于<%= time_ago_in_words reject_requisition.updated_at, false %>之前拒绝">
                  对方已拒绝你的交友申请
                </div>
              <% else %>
                <%= link_to_remote "加为好友",
                  :update => :right,
                  :url => url_for(:action => :not_my_friends,
                  :friend_id => friend.id,
                  :nick_name => @nick_name,
                  :sex => @sex
                ),
                  :html => {
                  :class => :addFriend
                }
              %>
              <% end %>
            <% end %>
          <% end %>
    <%#*<div class="letter"><a href="javascript:;">发站内信</a></div>%>
        </div>
      </div>
    <% end %>
  <% end %>
</div>
